package com.zqh.ordersave.controller;

import com.zqh.myfmmall.entity.Orders;
import com.zqh.myfmmall.result.Result;
import com.zqh.ordersave.service.OrdersSaveService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Description :
 * @Author :kono淇杭哒、
 * @Create 2022-02-18 2:15
 */
@RestController
@RequestMapping("order")
public class OrderSaveController{
    @Resource
    private OrdersSaveService ordersSaveService;

    @PostMapping("create")
    public Result create(@RequestBody Orders order){
        return ordersSaveService.save(order) ? Result.success(null) : Result.internalServerError("服务器开小差了，请重试");
    }
}
